javascript replace newline with br

76

javascript replace <br> with n -

var str = $("#mydiv").html();
var regex = /&lt;br\s*[\/]?&gt;/gi;
$("#mydiv").html(str.replace(regex, "\n"));

Comments

Submit
0 Comments